package com.cloud.system.api.mapper;

import com.cloud.system.api.entity.UnitInspect;
import com.cloud.system.common.utils.BaseMapperHelper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface UnitInspectMapper extends BaseMapperHelper<UnitInspect> {

    @Select("select * from unit_inspect where unit_id = #{unitId}")
    @Results({
            @Result(property = "inspectId",column = "inspect_id",javaType = Integer.class),
            @Result(property = "inspectName", column = "inspect_name", javaType = String.class),
            @Result(property = "powerName", column = "power_name", javaType = String.class),
            @Result(property = "supItemCode", column = "sup_item_code", javaType = String.class),
            @Result(property = "inspectExecuteListCode", column = "inspect_execute_list_code", javaType = String.class),
            @Result(property = "inspectTypeName", column = "inspect_type_name", javaType = String.class),
            @Result(property = "inspectMethodName", column = "inspect_method_name", javaType = String.class),
            @Result(property = "isIntoDoubleRandom", column = "is_into_double_random", javaType = String.class),
            @Result(property = "inspectRation", column = "inspect_ration", javaType = String.class),
            @Result(property = "inspectFreq", column = "inspect_freq", javaType = String.class),
            @Result(property = "dailyInspectContent", column = "daily_inspect_content", javaType = String.class),
            @Result(property = "specialInspectContent", column = "special_inspect_content", javaType = String.class),
            @Result(property = "isSpotInspect", column = "is_spot_inspect", javaType = String.class),
            @Result(property = "supSpotInspectContent", column = "sup_spot_inspect_content", javaType = String.class),
            @Result(property = "isCooperation", column = "is_cooperation", javaType = String.class),
            @Result(property = "cooperationUnits", column = "cooperation_units", javaType = String.class),
            @Result(property = "workFlow", column = "work_flow", javaType = String.class),
            @Result(property = "stateId", column = "state_id", javaType = String.class),
            @Result(property = "stateName", column = "state_name", javaType = String.class),
            @Result(property = "version", column = "version", javaType = Integer.class),
            @Result(property = "planEffectiveDate", column = "plan_effective_date", javaType = Date.class),
            @Result(property = "planExpiredDate", column = "plan_expired_date", javaType = Date.class),
    })
    List<UnitInspect> listPage(Long unitId);
}